<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2>Essential Links</h2>
    <el-button type="danger" round @click="logOut">退出</el-button>
    <el-button type="primary" round @click="hello">恩测试123</el-button>
    <input type="text" v-model.lazy="userName"/>
     <el-input
    placeholder="请选择日期"
    suffix-icon="el-icon-date"
    v-model="input2">
  </el-input>
   <el-input
    placeholder="请输入内容"
    prefix-icon="el-icon-search"
    v-model="input21">
  </el-input>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      userName:'',
      input21: '',
      input2: ''
    }
  },
  methods:{
    logOut:function(){
      var vm = this;
      this.$axios.logOut().then(function(res){
        vm.$router.push({path:'/login'});
      },function(res){
          vm.$notify({
                  title: '退出错误',
                  message: res.data.msg,
                  type: 'error'
                });
      })
    },
    hello:function(){
      this.$axios.queryComplaints();
     
    }
  },
  watch:{
    userName:{
      handler(curVal,oldVal){
        console.log(curVal);
      }
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
